const { createUser } = require('../service/user.service')

class UserController {
    async register(ctx, next) {
        // get data 
        const {user_name, password} = ctx.request.body
        // 操作数据库
        const res = await createUser(user_name, password)
        // 返回结果
        ctx.body = ctx.request.body
    }   
    async login(ctx, next) {
        ctx.body = "login success"
    }
}

module.exports = new UserController()